package com.example.demo.entity.primary;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongjunpeng on 2017/10/16.
 */
@Entity
@Table(name = "job_queue")
public class JobQueueEntity {
    private int jobQueueId;
    private String jobQueueCode;
    private String craneCode;
    private String craneName;
    private String jobType;
    private String userName;
    private Timestamp startTime;
    private Timestamp endTime;
    private String truckNo;
    private String ocrTruckNo;
    private Integer totalWeight;
    private Byte containerAmount;
    private String containers;
    private String pictures;
    private String processes;

    @Id
    @Column(name = "job_queue_id")
    public int getJobQueueId() {
        return jobQueueId;
    }

    public void setJobQueueId(int jobQueueId) {
        this.jobQueueId = jobQueueId;
    }

    @Basic
    @Column(name = "job_queue_code")
    public String getJobQueueCode() {
        return jobQueueCode;
    }

    public void setJobQueueCode(String jobQueueCode) {
        this.jobQueueCode = jobQueueCode;
    }

    @Basic
    @Column(name = "crane_code")
    public String getCraneCode() {
        return craneCode;
    }

    public void setCraneCode(String craneCode) {
        this.craneCode = craneCode;
    }

    @Basic
    @Column(name = "crane_name")
    public String getCraneName() {
        return craneName;
    }

    public void setCraneName(String craneName) {
        this.craneName = craneName;
    }

    @Basic
    @Column(name = "job_type")
    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "start_time")
    public Timestamp getStartTime() {
        return startTime;
    }

    public void setStartTime(Timestamp startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "end_time")
    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    @Basic
    @Column(name = "truck_no")
    public String getTruckNo() {
        return truckNo;
    }

    public void setTruckNo(String truckNo) {
        this.truckNo = truckNo;
    }

    @Basic
    @Column(name = "ocr_truck_no")
    public String getOcrTruckNo() {
        return ocrTruckNo;
    }

    public void setOcrTruckNo(String ocrTruckNo) {
        this.ocrTruckNo = ocrTruckNo;
    }

    @Basic
    @Column(name = "total_weight")
    public Integer getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(Integer totalWeight) {
        this.totalWeight = totalWeight;
    }

    @Basic
    @Column(name = "container_amount")
    public Byte getContainerAmount() {
        return containerAmount;
    }

    public void setContainerAmount(Byte containerAmount) {
        this.containerAmount = containerAmount;
    }

    @Basic
    @Column(name = "containers")
    public String getContainers() {
        return containers;
    }

    public void setContainers(String containers) {
        this.containers = containers;
    }

    @Basic
    @Column(name = "pictures")
    public String getPictures() {
        return pictures;
    }

    public void setPictures(String pictures) {
        this.pictures = pictures;
    }

    @Basic
    @Column(name = "processes")
    public String getProcesses() {
        return processes;
    }

    public void setProcesses(String processes) {
        this.processes = processes;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        JobQueueEntity that = (JobQueueEntity) o;

        if (jobQueueId != that.jobQueueId) return false;
        if (jobQueueCode != null ? !jobQueueCode.equals(that.jobQueueCode) : that.jobQueueCode != null) return false;
        if (craneCode != null ? !craneCode.equals(that.craneCode) : that.craneCode != null) return false;
        if (craneName != null ? !craneName.equals(that.craneName) : that.craneName != null) return false;
        if (jobType != null ? !jobType.equals(that.jobType) : that.jobType != null) return false;
        if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
        if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false;
        if (endTime != null ? !endTime.equals(that.endTime) : that.endTime != null) return false;
        if (truckNo != null ? !truckNo.equals(that.truckNo) : that.truckNo != null) return false;
        if (ocrTruckNo != null ? !ocrTruckNo.equals(that.ocrTruckNo) : that.ocrTruckNo != null) return false;
        if (totalWeight != null ? !totalWeight.equals(that.totalWeight) : that.totalWeight != null) return false;
        if (containerAmount != null ? !containerAmount.equals(that.containerAmount) : that.containerAmount != null)
            return false;
        if (containers != null ? !containers.equals(that.containers) : that.containers != null) return false;
        if (pictures != null ? !pictures.equals(that.pictures) : that.pictures != null) return false;
        if (processes != null ? !processes.equals(that.processes) : that.processes != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = jobQueueId;
        result = 31 * result + (jobQueueCode != null ? jobQueueCode.hashCode() : 0);
        result = 31 * result + (craneCode != null ? craneCode.hashCode() : 0);
        result = 31 * result + (craneName != null ? craneName.hashCode() : 0);
        result = 31 * result + (jobType != null ? jobType.hashCode() : 0);
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
        result = 31 * result + (truckNo != null ? truckNo.hashCode() : 0);
        result = 31 * result + (ocrTruckNo != null ? ocrTruckNo.hashCode() : 0);
        result = 31 * result + (totalWeight != null ? totalWeight.hashCode() : 0);
        result = 31 * result + (containerAmount != null ? containerAmount.hashCode() : 0);
        result = 31 * result + (containers != null ? containers.hashCode() : 0);
        result = 31 * result + (pictures != null ? pictures.hashCode() : 0);
        result = 31 * result + (processes != null ? processes.hashCode() : 0);
        return result;
    }
}
